//
//  ViewController.m
//  练习转场动画
//
//  Created by 苗钧豪 on 16/8/23.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "ViewController.h"
#import "pushTransitionAnimation.h"
#import "popTransitionAnimation.h"
@interface ViewController ()<UINavigationControllerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.navigationController.delegate = self;
}

- (nullable id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC  NS_AVAILABLE_IOS(7_0) {
    if (operation == UINavigationControllerOperationPush) {
        pushTransitionAnimation *push = [pushTransitionAnimation new];
        return push;
    } else if (operation == UINavigationControllerOperationPop) {
        popTransitionAnimation *pop = [popTransitionAnimation new];
        return pop;
    } else {
        return nil;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
